package com.study.entity;

import lombok.Data;

import java.util.List;

/**
 * Created by Administrator on 2017/10/19/019.
 */
@Data
public class PageInfo<T> {
    /**
     * 当前页数
     */
    private Integer pageNum;
    /**
     * 每页记录数
     */
    private Integer size;
    /**
     * 总页数
     */
    private Integer pages;
    /**
     * 总条数
     */
    private Integer total;
    /**
     * 记录
     */
    private List<T> list;


    public PageInfo(Integer pageNum, Integer size, Integer total, List<T> list) {
        this.pageNum = pageNum;
        this.size = size;
        this.total = total;
        this.list = list;
        if(total%size==0){
            this.pages=total/size;
        }else{
            this.pages=total/size+1;
        }
    }

    public PageInfo() {

    }
}
